//package dts.com.mx.seguridad;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.authentication.AuthenticationManager;
//
//@EnableWebSecurity
//@Configuration
//@EnableGlobalMethodSecurity(prePostEnabled=true)
//public class SecurityConfig extends WebSecurityConfigurerAdapter {
//
//  @Override
//  protected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception {
//    auth.inMemoryAuthentication()
//        .withUser("letsnosh").password("noshing").roles("USER");
//  }
//
//  @Override
//  protected void configure(HttpSecurity http) throws Exception {
//    http.authorizeUrls()
//        .antMatchers("/order/**").hasRole("USER")
//        .antMatchers("/checkout").hasRole("USER")
//        .anyRequest().anonymous()
//        .and()
//        //This will generate a login form if none is supplied.
//        .formLogin();
//  }
//
//  @Bean
//  @Override
//  public AuthenticationManager authenticationManagerBean() throws Exception {
//       return super.authenticationManagerBean();
//  }
//}